package com.example.mvpdemo.demo;

import android.widget.TextView;

import com.example.mvpdemo.R;
import com.example.mvpdemo.base.BaseMVPFragment;

public class HomeFragment extends BaseMVPFragment<HomePresenter> implements HomeContract.View {

    private TextView textView;

    @Override
    protected void initPresenter() {
        mPresenter = new HomePresenter();
        mPresenter.addContext(getActivity());
        mPresenter.attachView(this);
    }

    @Override
    protected int getLayout() {
        return R.layout.fragment_home;
    }

    @Override
    protected void initView(android.view.View view) {
        textView = view.findViewById(R.id.text);
        mPresenter.getText();
    }

    @Override
    public void showText(String text) {
        textView.setText(text);
        dismissDialog();
    }
}
